<?php

/**
 * CheltuialaFond form base class.
 *
 * @method CheltuialaFond getObject() Returns the current form's model object
 *
 * @package    acap
 * @subpackage form
 * @author     Verminu
 */
abstract class BaseCheltuialaFondForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                => new sfWidgetFormInputHidden(),
      'fond_id'           => new sfWidgetFormPropelChoice(array('model' => 'Fond', 'add_empty' => false)),
      'data'              => new sfWidgetFormDate(),
      'valoare'           => new sfWidgetFormInputText(),
      'serie'             => new sfWidgetFormInputText(),
      'descriere'         => new sfWidgetFormInputText(),
      'tip_cheltuiala_id' => new sfWidgetFormPropelChoice(array('model' => 'TipCheltuiala', 'add_empty' => false)),
      'created_at'        => new sfWidgetFormDate(),
      'updated_at'        => new sfWidgetFormDate(),
    ));

    $this->setValidators(array(
      'id'                => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
      'fond_id'           => new sfValidatorPropelChoice(array('model' => 'Fond', 'column' => 'id')),
      'data'              => new sfValidatorDate(),
      'valoare'           => new sfValidatorNumber(),
      'serie'             => new sfValidatorString(array('max_length' => 32, 'required' => false)),
      'descriere'         => new sfValidatorString(array('max_length' => 128, 'required' => false)),
      'tip_cheltuiala_id' => new sfValidatorPropelChoice(array('model' => 'TipCheltuiala', 'column' => 'id')),
      'created_at'        => new sfValidatorDate(array('required' => false)),
      'updated_at'        => new sfValidatorDate(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('cheltuiala_fond[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'CheltuialaFond';
  }


}
